/**
 * 
 */
package com.xinghou.platform.service.main.impl;

import com.xinghou.platform.dao.main.VisitFromDAO;
import com.xinghou.platform.dao.main.VisitToDAO;
import com.xinghou.platform.model.main.VisitFrom;
import com.xinghou.platform.model.main.VisitTo;
import com.xinghou.platform.service.main.VisitService;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author wxtdy
 *
 */
@Service("visitService")
public class VisitServiceImpl implements VisitService {
	
	@Resource
	private VisitFromDAO visitFromDAO;
	
	@Resource
	private VisitToDAO visitToDAO;

	/* (non-Javadoc)
	 * @see com.xinghou.platform.service.main.VisitService#saveVisit(com.xinghou.platform.model.main.VisitFrom, com.xinghou.platform.model.main.VisitTo)
	 */
	@Override
	public void saveVisit(VisitFrom visitFrom, VisitTo visitTo) throws DataAccessException {
		visitFromDAO.saveVisitFrom(visitFrom);
		visitToDAO.saveVisitTo(visitTo);
	}

	@Override
	public void updateVisit(VisitFrom visitFrom, VisitTo visitTo) throws DataAccessException {
		visitFromDAO.updateVisitFrom(visitFrom);
		visitToDAO.updateVisitTo(visitTo);
	}

}
